<h1>Showing warehouse</h1>

<p>
  <b>Name:</b>
  <%=h @warehouse.name %>
</p>

<p>
  <b>Street:</b>
  <%=h @warehouse.street %>
</p>

<p>
  <b>City:</b>
  <%=h @warehouse.city %>
</p>

<p>
  <b>Postal code:</b>
  <%=h @warehouse.postal_code %>
</p>

<p>
  <b>Country:</b>
  <%=h @warehouse.country %>
</p>

<p>
  <b>Area:</b>
  <%=h @warehouse.area %>
</p>

<p>
  <b>Products in stock:</b>
  <ul>
  <% @warehouse.positions.each do |position| %>
    <li>
	<% product = Product.find_by_id(position.product_id) %>
    <%= link_to product.name, product %> - <%= position.quantity %> <%= product.unit %>
	</li>
  <% end %>
  </ul>
</p>

<p>
  <b>Employees:</b>
  <% @warehouse.employees.each do |employee| %>
    <%= link_to employee.name  + ' ' + employee.surname, employee %>
  <% end %>
</p>

<%= link_to 'Edit', edit_warehouse_path(@warehouse) %> |
<%= link_to 'Delete', @warehouse, :confirm => 'Are you sure?', :method => :delete %> |
<%= link_to 'List', warehouses_path %>